let arr = [{
    sort: 3,
    name: 2
}, {
    sort: 4,
    name: 3
}, {
    sort: 1,
    name: 9
}]
let dd = [1, 2, 3, 7, 9, 4, 5]

function compare(a, b) {
    return a.sort - b.sort
}
console.log(arr.sort(compare))
console.log(arr)
console.log(dd.sort(function (a, b) {
    console.log("DDDD",a)
    console.log("CCCC",b)
    return b - a
}))
console.log(dd)
var points = [40, 100, 1, 5, 25, 10];
points.sort(function (a, b) {
    return a - b
});
console.log(points)